﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CourseModificationPage.aspx.vb" Inherits="DARSClients.CourseModificationPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Beyond DARS - Course Modification</title>
    <link id="Link1" href="Styles/myStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/myScripts.js" language="javascript"></script>
    <link id="myCSS" href="Styles/myStyle.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            font-size: x-large;
            color: #003300;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <h1>Course Modification</h1>
    <div class="container">
    <div class="style1">
    
        <strong><br />
        <br />
        </strong>
    
    </div>
    <p>
        <asp:Label ID="Label1" runat="server" 
            Text="Search courseID for course to modify:"></asp:Label>
&nbsp;<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </p>
    <p align="center">
        <asp:Button ID="Button1" runat="server" Text="Search" CssClass="btn2"/>
&nbsp;
        <asp:Label ID="Label2" runat="server" ForeColor="Red"></asp:Label>
&nbsp;</p>
    <p>
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/addCourse.aspx">Click here to add a new course.</asp:HyperLink>
    </p>
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
            CellPadding="3" DataKeyNames="CourseID" DataSourceID="SqlDataSource1" 
            ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="CourseID" HeaderText="CourseID" ReadOnly="True" 
                    SortExpression="CourseID" />
                <asp:BoundField DataField="CourseName" HeaderText="CourseName" 
                    SortExpression="CourseName" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="DepartmentID" HeaderText="DepartmentID" 
                    SortExpression="DepartmentID" />
                <asp:BoundField DataField="CreditsEarned" HeaderText="CreditsEarned" 
                    SortExpression="CreditsEarned" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:FA11_4296_BeyondDARSConnectionString %>" 
            DeleteCommand="DELETE FROM [Course] WHERE [CourseID] = @original_CourseID AND (([CourseName] = @original_CourseName) OR ([CourseName] IS NULL AND @original_CourseName IS NULL)) AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND [DepartmentID] = @original_DepartmentID AND (([CreditsEarned] = @original_CreditsEarned) OR ([CreditsEarned] IS NULL AND @original_CreditsEarned IS NULL))" 
            InsertCommand="INSERT INTO [Course] ([CourseID], [CourseName], [Description], [DepartmentID], [CreditsEarned]) VALUES (@CourseID, @CourseName, @Description, @DepartmentID, @CreditsEarned)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [Course] WHERE ([CourseID] = @CourseID)" 
            UpdateCommand="UPDATE [Course] SET [CourseName] = @CourseName, [Description] = @Description, [DepartmentID] = @DepartmentID, [CreditsEarned] = @CreditsEarned WHERE [CourseID] = @original_CourseID AND (([CourseName] = @original_CourseName) OR ([CourseName] IS NULL AND @original_CourseName IS NULL)) AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND [DepartmentID] = @original_DepartmentID AND (([CreditsEarned] = @original_CreditsEarned) OR ([CreditsEarned] IS NULL AND @original_CreditsEarned IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_CourseID" Type="String" />
                <asp:Parameter Name="original_CourseName" Type="String" />
                <asp:Parameter Name="original_Description" Type="String" />
                <asp:Parameter Name="original_DepartmentID" Type="String" />
                <asp:Parameter Name="original_CreditsEarned" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CourseID" Type="String" />
                <asp:Parameter Name="CourseName" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="DepartmentID" Type="String" />
                <asp:Parameter Name="CreditsEarned" Type="Int32" />
            </InsertParameters>
            <SelectParameters>
                <asp:SessionParameter Name="CourseID" SessionField="CourseID" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="CourseName" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="DepartmentID" Type="String" />
                <asp:Parameter Name="CreditsEarned" Type="Int32" />
                <asp:Parameter Name="original_CourseID" Type="String" />
                <asp:Parameter Name="original_CourseName" Type="String" />
                <asp:Parameter Name="original_Description" Type="String" />
                <asp:Parameter Name="original_DepartmentID" Type="String" />
                <asp:Parameter Name="original_CreditsEarned" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
        </div>
     <div class="footer">
        <a><input  type="submit" class="text_button" id="btnLogout" runat="server" 
                value="Logout" causesvalidation="False" />
           <input type="submit" class="text_button" id="btnhome" runat="server" 
                value="Home" causesvalidation="False" /> </a>
        </div>
    </form>
</body>
</html>
